home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / auror300.zip / KEYDEF.AML < prev    next >
Text File  |  1996-07-17  |  5KB  |  265 lines

  1. //--------------------------------------------------------------------
  2. // KEYDEF.AML
  3. // Show Assigned State of all Keys, (C) 1993-1996 by nuText Systems
  4. //
  5. // (see Keydef.dox for user help)
  6. //
  7. // This macro displays a popup menu showing assigned and unassigned keys
  8. // for the current window type (edit windows or file manager windows).
  9. //
  10. // Usage:
  11. //
  12. // Select this macro from the Macro List (on the Macro menu), or run it
  13. // from the macro picklist <shift f12>.
  14. //
  15. // This macro can also be run by selecting Show Available Keys from the
  16. // Macro menu.
  17. //--------------------------------------------------------------------
  18.  
  19. // compile time macros and function definitions
  20. include bootpath "define.aml"
  21.  
  22. // create a data buffer with all the keynames
  23. databuf "keynames"
  24.   "<alt '>"
  25.   "<alt ,>"
  26.   "<alt ->"
  27.   "<alt .>"
  28.   "<alt />"
  29.   "<alt 0>"
  30.   "<alt 1>"
  31.   "<alt 2>"
  32.   "<alt 3>"
  33.   "<alt 4>"
  34.   "<alt 5>"
  35.   "<alt 6>"
  36.   "<alt 7>"
  37.   "<alt 8>"
  38.   "<alt 9>"
  39.   "<alt ;>"
  40.   "<alt =>"
  41.   "<alt a>"
  42.   "<alt b>"
  43.   "<alt backspace>"
  44.   "<alt c>"
  45.   "<alt d>"
  46.   "<alt del>"
  47.   "<alt down>"
  48.   "<alt e>"
  49.   "<alt end>"
  50.   "<alt enter>"
  51.   "<alt esc>"
  52.   "<alt f10>"
  53.   "<alt f11>"
  54.   "<alt f12>"
  55.   "<alt f1>"
  56.   "<alt f2>"
  57.   "<alt f3>"
  58.   "<alt f4>"
  59.   "<alt f5>"
  60.   "<alt f6>"
  61.   "<alt f7>"
  62.   "<alt f8>"
  63.   "<alt f9>"
  64.   "<alt f>"
  65.   "<alt g>"
  66.   "<alt grey*>"
  67.   "<alt grey+>"
  68.   "<alt grey->"
  69.   "<alt grey/>"
  70.   "<alt greyenter>"
  71.   "<alt h>"
  72.   "<alt home>"
  73.   "<alt i>"
  74.   "<alt ins>"
  75.   "<alt j>"
  76.   "<alt k>"
  77.   "<alt l>"
  78.   "<alt left>"
  79.   "<alt m>"
  80.   "<alt n>"
  81.   "<alt o>"
  82.   "<alt p>"
  83.   "<alt pgdn>"
  84.   "<alt pgup>"
  85.   "<alt q>"
  86.   "<alt r>"
  87.   "<alt right>"
  88.   "<alt s>"
  89.   "<alt t>"
  90.   "<alt tab>"
  91.   "<alt u>"
  92.   "<alt up>"
  93.   "<alt v>"
  94.   "<alt w>"
  95.   "<alt x>"
  96.   "<alt y>"
  97.   "<alt z>"
  98.   "<alt [>"
  99.   "<alt \\>"
  100.   "<alt ]>"
  101.   "<alt `>"
  102.   "<backspace>"
  103.   "<center>"
  104.   "<char>"
  105.   "<ctrl ->"
  106.   "<ctrl 2>"
  107.   "<ctrl 6>"
  108.   "<ctrl a>"
  109.   "<ctrl b>"
  110.   "<ctrl backspace>"
  111.   "<ctrl c>"
  112.   "<ctrl center>"
  113.   "<ctrl d>"
  114.   "<ctrl del>"
  115.   "<ctrl down>"
  116.   "<ctrl e>"
  117.   "<ctrl end>"
  118.   "<ctrl enter>"
  119.   "<ctrl f10>"
  120.   "<ctrl f11>"
  121.   "<ctrl f12>"
  122.   "<ctrl f1>"
  123.   "<ctrl f2>"
  124.   "<ctrl f3>"
  125.   "<ctrl f4>"
  126.   "<ctrl f5>"
  127.   "<ctrl f6>"
  128.   "<ctrl f7>"
  129.   "<ctrl f8>"
  130.   "<ctrl f9>"
  131.   "<ctrl f>"
  132.   "<ctrl g>"
  133.   "<ctrl grey*>"
  134.   "<ctrl grey+>"
  135.   "<ctrl grey->"
  136.   "<ctrl grey/>"
  137.   "<ctrl greyenter>"
  138.   "<ctrl h>"
  139.   "<ctrl home>"
  140.   "<ctrl i>"
  141.   "<ctrl ins>"
  142.   "<ctrl j>"
  143.   "<ctrl k>"
  144.   "<ctrl l>"
  145.   "<ctrl left>"
  146.   "<ctrl m>"
  147.   "<ctrl n>"
  148.   "<ctrl o>"
  149.   "<ctrl p>"
  150.   "<ctrl pgdn>"
  151.   "<ctrl pgup>"
  152.   "<ctrl prtsc>"
  153.   "<ctrl q>"
  154.   "<ctrl r>"
  155.   "<ctrl right>"
  156.   "<ctrl s>"
  157.   "<ctrl t>"
  158.   "<ctrl tab>"
  159.   "<ctrl u>"
  160.   "<ctrl up>"
  161.   "<ctrl v>"
  162.   "<ctrl w>"
  163.   "<ctrl x>"
  164.   "<ctrl y>"
  165.   "<ctrl z>"
  166.   "<ctrl [>"
  167.   "<ctrl \\>"
  168.   "<ctrl ]>"
  169.   "<del>"
  170.   "<down>"
  171.   "<end>"
  172.   "<enter>"
  173.   "<esc>"
  174.   "<f10>"
  175.   "<f11>"
  176.   "<f12>"
  177.   "<f1>"
  178.   "<f2>"
  179.   "<f3>"
  180.   "<f4>"
  181.   "<f5>"
  182.   "<f6>"
  183.   "<f7>"
  184.   "<f8>"
  185.   "<f9>"
  186.   "<grey*>"
  187.   "<grey+>"
  188.   "<grey->"
  189.   "<greyenter>"
  190.   "<home>"
  191.   "<ins>"
  192.   "<left>"
  193.   "<otherkey>"
  194.   "<pgdn>"
  195.   "<pgup>"
  196.   "<right>"
  197.   "<shift center>"
  198.   "<shift del>"
  199.   "<shift down>"
  200.   "<shift end>"
  201.   "<shift f10>"
  202.   "<shift f11>"
  203.   "<shift f12>"
  204.   "<shift f1>"
  205.   "<shift f2>"
  206.   "<shift f3>"
  207.   "<shift f4>"
  208.   "<shift f5>"
  209.   "<shift f6>"
  210.   "<shift f7>"
  211.   "<shift f8>"
  212.   "<shift f9>"
  213.   "<shift home>"
  214.   "<shift ins>"
  215.   "<shift left>"
  216.   "<shift pgdn>"
  217.   "<shift pgup>"
  218.   "<shift right>"
  219.   "<shift tab>"
  220.   "<shift up>"
  221.   "<shiftkey>"
  222.   "<tab>"
  223.   "<up>"
  224. end
  225.  
  226. // get the window event object
  227. obj = getwinobj
  228.  
  229. // do for all lines in the data buffer
  230. repeat
  231.   // check for the key function in the window object path
  232.   if function? (gettext) obj then
  233.     ovltext "Assigned" 19
  234.   end
  235. until not down
  236.  
  237. // display the buffer in a popup menu and get the key selected
  238. keystr = popup (getcurrbuf) obj + " window keys" 26
  239.  
  240. // destroy the key data buffer
  241. destroybuf
  242.  
  243. // key string was selected
  244. if keystr then
  245.  
  246.   // if assigned, then go to the keydef in Kbd.aml
  247.   if keystr [0] <> '>' then
  248.     keystr = keystr [1 : pos '>' keystr 'r']
  249.     open (bootpath "kbd.aml")
  250.     gotopos 1 1
  251.     if objtype? "fmgr" obj then
  252.       find "object fmgr"
  253.     end
  254.     if find keystr then
  255.       send "onfound" length keystr
  256.     else
  257.       gotopos 1 1
  258.     end
  259.  
  260.   // if not assigned, then write the key string at the cursor
  261.   else
  262.     send "write" keystr
  263.   end
  264. end
  265.